<?php
namespace app\kaifangyuyue\controller;
use think\Controller;
use think\Db;

class YuYue extends Controller {
	
	public function index() {
		return $this->fetch();
	}

	public function add(){
		return $this->fetch();
	}
	
	public function query() {
		return $this->fetch();
	}
	
	public function upload() {
		return $this->fetch();
	}
	
	/**
	* thinkphp5 sql文档 https://www.kancloud.cn/manual/thinkphp5/135175
	*/
	public function getData() {
		//input获取参数
		$zqh = input('zqh');
		$where["联系电话1"] = $zqh;
		$data = Db::table("开放预约")
		->where($where)
		->find();//单条记录用find()多条记录用select()
		return $data;
	}
	
	public function addData() {
		$xuhao = strtotime('now'));
		$param = request()->param();
		$param["序号"] = $xuhao;
		insert('教师常规参数', $param);
		return $param;
	}
	
	public function getList() {
		$data = Db::table("开放预约")
		->order("联系电话1 desc")
        ->page(1, 10) //分页查询第1页 10条记录 
		->select();//单条记录用find()多条记录用select()
		return $data;
	}
	
}
